<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<script type="text/javascript">
    var newsManageDataGrid;
    $(function() {
        newsManageDataGrid = $('#newsManageDataGrid1').datagrid({
            url : '${path }/newsManage/dataGrid1',
            striped : true,
            rownumbers : true,
            pagination : true,
            singleSelect : true,
            idField : 'id',
            sortName : 'id',
            sortOrder : 'asc',
            pageSize : 20,
            pageList : [ 10, 20, 30, 40, 50, 100, 200, 300, 400, 500 ],
            frozenColumns : [ [ {
                width : '100',
                title : '发布人',
                field : 'userName'
            },{
                field: 'title',
                title: '标题',
                width: 200, formatter: function (value, row, index) {
                    console.info(row);
                    return "<a href='javascript:;' onclick= displayNewsFun('" + row.id + "');>" + value + "</a>";

                }
            },{
                width : '200',
                title : '发布时间',
                field : 'createTime'
            } ] ],
        });
    });

    function displayNewsFun(value) {
        parent.$.modalDialog({
            title : '内容',
            width : 500,
            height : 300,
            href : '${path }/newsManage/display?id='+value,
        });
    }
</script>

<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',fit:true,border:false">
        <table id="newsManageDataGrid1" data-options="fit:true,border:false"></table>
    </div>
</div>


